Fix tau-bench token deltas for reasoning templates#2213
Draft
DongzhuoranZhou wants to merge 3 commits into
Draft
Fix tau-bench token deltas for reasoning templates#2213DongzhuoranZhou wants to merge 3 commits into
DongzhuoranZhou wants to merge 3 commits into
Conversation
DongzhuoranZhou
force-pushed
the
codex/fix-qwen3-thinking-token-delta
branch
from
July 16, 2026 09:11
43827e7 to
0c40ed5
Compare
Co-authored-by: Yuki <70699639+Y-L-LIU@users.noreply.github.com>
DongzhuoranZhou
force-pushed
the
codex/fix-qwen3-thinking-token-delta
branch
from
July 16, 2026 09:12
0c40ed5 to
55e6d33
Compare
Co-authored-by: Yuki <70699639+Y-L-LIU@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The tau-bench example used
curr[len(prev):]for every newly appended message. Qwen3 violates that assumption in two ways:currno longer starts withprev; slicing by the old length can truncate the new user.<|im_start|>assistant\n<think>.A further tokenizer boundary case matters: a continuation beginning with whitespace can BPE-merge with the end of the generation prefix, so separately tokenized prefix IDs are not guaranteed to be an exact token prefix of the combined assistant span.
Fix
This retains the existing tau-bench update convention: accumulated GRPO training tokens keep prior reasoning. The change fixes token construction and masks; it does not change rollout visibility semantics.
Validation
pytest -q tests/test_tau_bench_token_delta.py— 4 passedMultiTurnLossMaskGenerator(..., tokenizer_type="qwen3"):